package sw.mylife;
import sw.mylife.system.MyLog;
import android.content.ComponentName;
import android.content.ServiceConnection;
import android.os.IBinder;

public class SyncServiceConnection implements ServiceConnection{
	private SyncService service;
	private final String LOGTAG = "SyncServiceConnection";
	
	
	@Override
	public void onServiceConnected(ComponentName className, IBinder binder) {
		service = ((SyncService.MyBinder) binder).getService();
		MyLog.d(LOGTAG, "Connection with "+className.getClassName()+" established");
		
	}

	@Override
	public void onServiceDisconnected(ComponentName className) {
		service = null;
	}

	public SyncService getService(){
		return this.service;
	}
}
